<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('活动列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>活动编码：</label>
                                <input type="text" name="activityId"/>
                            </li>
                            <li>
                                <label>社群ID：</label>
                                <input type="text" name="communityId"/>
                            </li>
                            <li>
                                <label>活动标题：</label>
                                <input type="text" name="activityTitle"/>
                            </li>
                            <li>
                                <label>活动详情：</label>
                                <input type="text" name="activityIntroduction"/>
                            </li>
                            <li>
                                <label>活动分类：</label>
                                <input type="text" name="activityClassification"/>
                            </li>
                            <li>
                                <label>经度：</label>
                                <input type="text" name="longitude"/>
                            </li>
                            <li>
                                <label>纬度：</label>
                                <input type="text" name="latitude"/>
                            </li>
                            <li>
                                <label>地址：</label>
                                <input type="text" name="activityAddress"/>
                            </li>
                            <li>
                                <label>报名回答问题：</label>
                                <input type="text" name="question"/>
                            </li>
                            <li>
                                <label>主理人电话：</label>
                                <input type="text" name="managerPhone"/>
                            </li>
                            <li>
                                <label>主理人微信：</label>
                                <input type="text" name="managerWechat"/>
                            </li>
                            <li>
                                <label>主理人微信群链接图片：</label>
                                <input type="text" name="managerWechatGroupPic"/>
                            </li>
                            <li>
                                <label>创建活动用户Id：</label>
                                <input type="text" name="userId"/>
                            </li>
                            <li>
                                <label>活动开始时间：</label>
                                <input type="text" class="time-input" placeholder="请选择活动开始时间" name="startTime"/>
                            </li>
                            <li>
                                <label>活动结束时间：</label>
                                <input type="text" class="time-input" placeholder="请选择活动结束时间" name="endTime"/>
                            </li>
                            <li>
                                <label>更新者：</label>
                                <input type="text" name="updateUser"/>
                            </li>
                            <li>
                                <label>是否有效 1有效 0 无效：</label>
                                <input type="text" name="yn"/>
                            </li>
                            <li>
                                <label>创建者：</label>
                                <input type="text" name="createUser"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:activity:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:activity:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:activity:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:activity:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:activity:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:activity:remove')}]];
        var prefix = ctx + "system/activity";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "活动",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'activityId',
                    title: '活动编码'
                },
                {
                    field: 'communityId',
                    title: '社群ID'
                },
                {
                    field: 'activityTitle',
                    title: '活动标题'
                },
                {
                    field: 'activityIntroduction',
                    title: '活动详情'
                },
                {
                    field: 'activityStatus',
                    title: '活动状态 0-未开放，1报名中，2已结束，3取消'
                },
                {
                    field: 'activityType',
                    title: '活动形式 0-线上，1线下，2混合'
                },
                {
                    field: 'activityClassification',
                    title: '活动分类'
                },
                {
                    field: 'longitude',
                    title: '经度'
                },
                {
                    field: 'latitude',
                    title: '纬度'
                },
                {
                    field: 'activityAddress',
                    title: '地址'
                },
                {
                    field: 'question',
                    title: '报名回答问题'
                },
                {
                    field: 'managerPhone',
                    title: '主理人电话'
                },
                {
                    field: 'managerWechat',
                    title: '主理人微信'
                },
                {
                    field: 'managerWechatGroupPic',
                    title: '主理人微信群链接图片'
                },
                {
                    field: 'privacyType',
                    title: '隐私性设置类型：1公开：所有人均可看到，均可报名
2仅社群成员参加：所有人均可看到，仅社群成员才能报名'
                },
                {
                    field: 'userId',
                    title: '创建活动用户Id'
                },
                {
                    field: 'startTime',
                    title: '活动开始时间'
                },
                {
                    field: 'endTime',
                    title: '活动结束时间'
                },
                {
                    field: 'updateUser',
                    title: '更新者'
                },
                {
                    field: 'yn',
                    title: '是否有效 1有效 0 无效'
                },
                {
                    field: 'createUser',
                    title: '创建者'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>